package com.uwlaser.domain;

import com.uwlaser.utils.DateUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.http.HttpStatus;

@Getter
@Setter
@ToString
public class ResultEntity<T> {

    private  Integer status;

    private  String message;

    private  T data;

    private String timestamp;

    public ResultEntity() {
       this(null,"",HttpStatus.OK);
    }

    public ResultEntity(T data) {
        this(data, "",HttpStatus.OK);
    }

    public ResultEntity(T data ,String message) {
        this(data,message,HttpStatus.OK);
    }

    public ResultEntity(T data  ,String message,  HttpStatus status) {
        this(data,message,status.value());
    }

    public ResultEntity(T data  ,String message,  Integer status) {
        this.status = status;
        this.message = message;
        this.data = data;
        this.timestamp = DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss");;
    }

}
